from django.contrib import admin
from .models import Category,Link

# Register your models here.
@admin.register(Category)
class CategoryAdmin(admin.ModelAdmin):
    # 设置哪些字段可以点击进入编辑界面
    list_display = ['id','name']

@admin.register(Link)
class LinkAdmin(admin.ModelAdmin):
    list_display = ['id','category_id','name','slink']
    list_filter = ['category_id','name','slink']
    search_fields = ['name','slink']

    # list_editable = ['category_id']
    fk_fields = ['category_id']

# admin.site.register(Category,CategoryAdmin)
# admin.site.register(Link,CategoryAdmin)

# admin.site.register(Menu)